<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>微信公众号文章被封检测</title>
<style>
* { margin:0; padding:0; font-size:14px; }
body { padding:10px; text-align:center; }
h1 { font-size:18px; margin:10px 0; }
input { padding:10px; width:80%; }
button { padding:10px; margin-left:10px; }
p {margin:20px 0;}
</style>
<script src="//cdn.bootcss.com/jquery/2.2.3/jquery.min.js"></script>
</head>
<body>
<h1>微信公众号文章被封检测</h1>
<input type="text" id="url"><button type="submit" id="go">检测</button>
<p id="msg"></p>

<script>
function go(url) {
    var API_URL = '1.php',
        $msg = $('#msg');

    $msg.html('正在检测中，请稍等。。。');

    $.getJSON(API_URL, {url : url}, function(j) {
        $msg.html(j.m);
    });
}

$('#go').click(function() {
    var url = $.trim($('#url').val());

    if (url.length < 5) {
        alert('请输入待检测网址');

        return false;
    }

    go(url);
});

/**
 * 绑定回车键至查询按钮
 */
$(window).on('keydown', function(e) {
    if(e.keyCode == '13') {
        $('#go').trigger('click');
    }
});
</script>
</body>
</html>
